<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="/mb/jsp/common.jsp" %>
<%@ page import="com.wsu.search.tools.Tools" %>
<%
    //取得url带过来的参数
    String studyid = Tools.RmNull(request.getParameter("studyid"));

%>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>公告详情</title>
</head>
<body ontouchstart="">
<div class="detailTop pf w100 of">
    <div class="w100 of tc cf f18">
        <span class="pa" style="left: 2px;" onclick="javascript:history.back();"><img src="mb/images/top_back_white.png"
                                                                                      style="margin-top: 4px;height: 40px;width: 40px;"/></span>
       	公告详情
    </div>
</div>

<div class="container db jz" style="padding-bottom: 0;padding-top: 46px;">
    <div id="container w100">
    	
    	
    	
    	
        <div id="resText"></div><!--resText-->
        <div id="loading" class="w100">
            <img src="mb/images/loading.gif" alt="正在加载" class="db jz hauto" style="width: 15px;">
            <div class="w100 tc f10 c9">正在加载</div>
        </div>
        
        
	</div>
	
	
	  	<!--footer-->
<footer id="footer" class="footerTab w100 of pf">
 
</footer>
<script type="text/javascript" src="mb/js/Base64.js"></script>
<script>

		$(window).on("load", function() {
				headertabcurrent=4;
				$("#footer").load("mb/footer.jsp"); 
	    })


    //加载新数据
    function getData() {
        $.ajax({
            url: "LoginServlet",
            data: JSON.stringify({m: 105,studyid:<%=studyid%>}),
            type: 'post',
            dataType: 'json',
            contentType: "application/json;charset=utf-8",
            beforeSend: function () {
                showProgressDg();
            },
            success: function (data) {
               if (data.state == 1) {
                  showData(data.obj);
                } else {
                    // 其他错误弹出提示
                    showToast(data.info);
                }
            },
            error: function (data) {
                showToast(data.info);
            },
            complete: function () {
                closeProgressDg();
            }
        });
    }
    
    
      function showData(obj){
      
     /* 	 var b = new Base64();
     	 var studycontent = b.decode(obj.studycontent);
     	 console.log(studycontent); */
     	
   		var htmlStr ='<div class="flexCenter activitiesTittle of mgt10">'+
				    	'<img alt="" src="mb/images/activitiesTittle_01.png">'+
				    	'<h4 class="tc f16 c3">'+obj.studytitle+'</h4>'+
				    	'<img alt="" src="mb/images/activitiesTittle_02.png">'+
			    	'</div>'+
			    	'<section class="proSection pr w92 jz bcf mgt10" style="border-radius:5px;">'+
			    		'<img  alt="" src="mb/images/activitiesLable.png" class="pa hauto" style="width:6%;top:-1px;right:5%;">'+
			    		'<article  style="padding:15px 10px;">'+
			    			'<iframe src="mb/jsp/showBase64.jsp?studyid='+obj.studyid+'&m=105" class="w100 db of"  frameborder="0" scrolling="no"  vsspace="0" hspace="0" marginwidth="0" marginheight="0">'+
	        				
	        				'</iframe>'+
			    			'<p class="lh2 tr c3 f14">'+dataToString(obj.createtime,"YYYY-MM-dd")+'</p>'+
			    		'</article>'+
	   				'</section>'
    		   	
   				
    	 $("#container").html(htmlStr);
    } 
    
    
    $(document).ready(function(){
    
		getData();
		var htmlStr ='<div class="flexCenter activitiesTittle of mgt10">'+
				    	'<img alt="" src="mb/images/activitiesTittle_01.png">'+
				    	'<h4 class="tc f16 c3">'+obj.studytitle+'</h4>'+
				    	'<img alt="" src="mb/images/activitiesTittle_02.png">'+
			    	'</div>'+
			    	'<section class="proSection pr w92 jz bcf mgt10" style="border-radius:5px;">'+
			    		'<img  alt="" src="mb/images/activitiesLable.png" class="pa hauto" style="width:6%;top:-1px;right:5%;">'+
			    		'<article  style="padding:15px 10px;">'+
			    			'<p>content goes here</p>'+
			    			'<p class="lh2 tr c3 f14">'+dataToString(obj.createtime,"YYYY-MM-dd")+'</p>'+
			    		'</article>'+
	   				'</section>'; 
    		   	
   				
    	 $("#container").html(htmlStr);
	});
</script>
</body>
</html>
